package com.wpml.designmode.strategy;

/**
 * @Description
 * @Date 2021-05-14
 * @Author wangpei
 **/
public class Cat {

    int height, weight;

    public Cat(int height, int weight) {
        this.height = height;
        this.weight = weight;
    }

    public int compareTo(Cat cat) {

//        return Integer.compare(this.weight, cat.weight);

        if (this.weight < cat.weight) return -1;

        if (this.weight > cat.weight) return 1;

        return 0;

    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    @Override
    public String toString() {
        return "Cat{" +
                "height=" + height +
                ", weight=" + weight +
                '}';
    }
}
